<template>
	<view class="content">
		<view class="scheme_content">
			<view class="title_content">
				<text class="top_title" style="flex:flex: auto;">训练预约</text>
				<uni-icons class="uni-icon" type="right" size="30" color="gray"></uni-icons>
			</view>
			<image class="scheme_image" src="https://ehealth.ipd.hihonor.com/etmcstatic/iv_train.png"></image>
			<block v-if="reserveList&&reserveList.length">
				<text class="scheme_title">您有<text class="BebasNeueBold"
						style="color:rgb(246,82,80);font-size:50rpx;">{{totalNumber}}</text>
					<text>个训练任务</text>
				</text>
				<view class="train_place">
					<block v-for="(item,index) in reserveList" :key="index">
						<view class="train_content">
							<text class="train_place_title">{{item.location}}</text>
							<text class="train_place_value">{{item.dateFormat}}</text>
							<button :class="item.disabled?'train_start_disable':'train_start'" :disabled="item.disabled"
								type="warn">开始</button>
						</view>
						<view class="subscrib_line" v-if="reserveList&&reserveList.length-1!=index"></view>
					</block>
				</view>
				<button class="reserve red-btn">立即预约</button>
			</block>
			<block v-else>
				<text class="no_reserve_title">您有<text class="BebasNeueBold"
						style="color:rgb(246,82,80);font-size:50rpx;">0</text>
					<text>个训练任务</text>
				</text>
				<text class="no_reserve_tip">设定任务，更好的达成目标</text>
				<button class="red-btn">立即预约</button>
			</block>
		</view>
	</view>


</template>

<script>
	export default {
		data() {
			return {
				reserveList: [],
				totalNumber: 0,
			}
		},
		props: {
			dataList: {
				type: Array,
				default: []
			},
		},
		methods: {

		},
	}
</script>

<style>
	.content {
		margin-top: 32rpx;
	}

	.content,
	.train_content {
		display: flex;
		flex-direction: column;
		justify-content: center;
		position: relative;
	}

	.no_reserve_title {
		color: rgba(0, 0, 0, 0.87);
		font-size: 32rpx;
		margin-bottom: 4rpx;
		padding: 0 32rpx;
	}

	.no_reserve_tip {
		color: rgba(0, 0, 0, 0.82);
		font-size: 24rpx;
		padding: 0 32rpx;
	}

	.red-btn {
		align-items: center;
		background-color: #ea3e3c;
		border: 1rpx solid rgba(250, 81, 80, 0.5);
		border-radius: 40rpx;
		color: #fff;
		display: flex;
		font-size: 32rpx;
		height: 75rpx;
		justify-content: center;
		margin: 60rpx 32rpx 20rpx;
		width: 210rpx;
	}

	.red-btn::after {
		display: none;
	}

	.reserve {
		height: 70rpx;
		margin: 0 0 20rpx 40rpx;
		width: 241rpx;
	}

	.top_title {
		color: rgba(0, 0, 0, 0.871);
		font-size: 32rpx;
		font-weight: 700;
	}

	.uni-icon {
		color: rgba(0, 0, 0, 0.467);
		font-size: 32rpx;
	}

	.scheme_image {
		display: flex;
		height: 263rpx;
		position: absolute;
		right: 32rpx;
		top: 90rpx;
		width: 229rpx;
	}

	.subscrib_line {
		background: rgba(0, 0, 0, 0.27);
		display: block;
		height: 0rpx;
		margin: 18rpx 0;
	}

	.train_start {
		align-items: center;
		background-color: #ef4141;
		border-radius: 50rpx;
		color: #fff;
		display: -webkit-flex;
		display: flex;
		font-size: 24rpx;
		height: 56rpx;
		justify-content: center;
		position: absolute;
		right: 0rpx;
		width: auto;
	}

	.train_start:active {
		background-color: #f79f9f;
	}

	.train_start_disable {
		align-items: center;
		background-color: #a8abbb !important;
		border-radius: 50rpx;
		color: #fff;
		display: -webkit-flex;
		display: flex;
		font-size: 24rpx;
		height: 56rpx;
		justify-content: center;
		position: absolute;
		right: 0rpx;
	}

	.train_start_disable::after {
		display: none;
	}

	.scheme_content {
		background-color: #f8ebe3;
		flex-direction: column;
		margin-left: 24rpx;
		margin-right: 24rpx;
		min-height: 360rpx;
		position: relative;
	}

	.scheme_content,
	.title_content {
		border-radius: 30rpx;
		display: flex;
	}

	.title_content {
		align-items: center;
		flex-direction: row;
		font-weight: 700;
		justify-content: space-between;
		padding: 32rpx 32rpx 12rpx;
		z-index: 1;
	}

	.title_content:active {
		background-color: #eee;
	}

	.scheme_title {
		color: rgba(0, 0, 0, 0.87);
		font-size: 32rpx;
		padding: 0 32rpx;
	}

	.train_place {
		background-color: hsla(0, 0%, 100%, 0.9);
		border-radius: 20rpx;
		display: -webkit-flex;
		display: flex;
		flex-direction: column;
		margin: 17rpx 32rpx 32rpx;
		padding: 16rpx;
		z-index: 2;
	}

	.train_place_title {
		color: rgba(0, 0, 0, 0.87);
		font-size: 28rpx;
	}

	.train_place_value {
		color: rgba(0, 0, 0, 0.57);
		font-size: 24rpx;
		margin-top: 8rpx;
	}

	.BebasNeueBold {
		font-family: BebasNeueBold;
	}
</style>